package com.xy.cglibproxy;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/15 22:44
 * @description
 */
public class Client {
    public static void main(String[] args) {
        // 被代理类
        TeacherDao target = new TeacherDao();

        // 创建对象代理
        TeacherDao proxyTeacher =(TeacherDao) new ProxyFactory(target).getProxyInstance();

        // 执行方法
        proxyTeacher.teach();

        System.out.println("----------");

        // 测试类
        ((Test)new ProxyFactory(new Test()).getProxyInstance()).test();
    }
}
